package cn.edu.nchu.fragmentdemo.bean;
import com.j256.ormlite.dao.ForeignCollection;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.table.DatabaseTable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author 林
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@DatabaseTable(tableName = "route")
public class Route  {
    @DatabaseField(columnName = "id", generatedId = true)
    private int id;

    @DatabaseField(columnName = "uk")
    private String uk;

    @DatabaseField(columnName = "use_altitude")
    private int useAltitude;

    @DatabaseField(columnName = "route_points")
    private int routePoints;

    @ForeignCollectionField(eager = false)
    private ForeignCollection<WayPoint> wayPoints;

    @DatabaseField(columnName = "fly_height")
    private double flyHeight;

    @DatabaseField(columnName = "fly_speed")
    private double flySpeed;

    @DatabaseField(columnName = "fly_yaw_angle",defaultValue = "0")
    private int flyYawAngle;

    @DatabaseField(columnName = "task_finish_action")
    private int taskFinishAction;

    @DatabaseField(columnName = "out_of_control_protect_action")
    private int outOfControlProtectAction;

    @DatabaseField(columnName = "hover_time")
    private double hoverTime;

    @DatabaseField(columnName = "up_speed")
    private double upSpeed;

    @DatabaseField(columnName = "down_speed")
    private double downSpeed;

    @DatabaseField(columnName = "route_length")
    private double routeLength;

    @DatabaseField(columnName = "estimated_time")
    private String estimatedTime;

    @DatabaseField(columnName = "photo_points")
    private int photoPoints;

    @DatabaseField(columnName = "route_task_id", foreign = true, foreignAutoRefresh = true)
    private RouteTask routeTask;
}